package com.example.administrator.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by Administrator on 2016/7/29.
 */
public class VpSimpleFragment extends Fragment {
    private String mtitle ;
    public  final static String BUNDLE_TITLE = "title" ;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        Bundle bundle = getArguments() ;
        if (bundle != null){
            mtitle = bundle.getString(BUNDLE_TITLE) ;
        }

        TextView tv = new TextView(getActivity()) ;
        tv.setText(mtitle);
        tv.setGravity(Gravity.CENTER);

        return tv;

    }

    public static VpSimpleFragment newInstance(String mtitle){
        Bundle bundle = new Bundle() ;
        bundle.putString(BUNDLE_TITLE,mtitle);
        VpSimpleFragment fragment = new VpSimpleFragment() ;
        fragment.setArguments(bundle);
        return fragment ;
    }
}
